<div nz-row>
  <div nz-col nzSpan="4">

    <nz-tree
      [nzData]="dl"
      (nzClick)="onClickNode($event)"
      [nzTreeTemplate]="nzTreeTemplate"
      (nzContextMenu)="onClickNode($event)"
    ></nz-tree>

    <ng-template #nzTreeTemplate let-node  let-origin="origin">
      <span class="custom-node">
        <span  (contextmenu)="contextMenu($event, menu,node.key)">
          <i nz-icon ></i>
          <span class="folder-name">{{ node.title }}</span>
        </span>
      </span>
    </ng-template>

    <nz-dropdown-menu #menu="nzDropdownMenu" >
      <ul nz-menu>
        <li nz-menu-item  *ngIf="isshowadd" (click)="add()">添加</li>
        <li nz-menu-item (click)="update()">修改</li>
        <li nz-menu-item (click)="delete()">删除</li>
      </ul>
    </nz-dropdown-menu>
  </div>

  <div nz-col nzSpan="20">


    <nz-card  nzTitle="用户列表" [nzExtra]="extraTemplate">

      <nz-table #basicTable [nzData]="al">
        <thead>
        <tr>
          <th>用户名</th>
          <th>姓名</th>
          <th>联系电话</th>

          <th>所属部门</th>
          <th>岗位</th>
          <th>状态</th>

          <th>操作</th>
        </tr>
        </thead>
        <tbody>
        <tr *ngFor="let data of basicTable.data">
          <td>{{data.name}}</td>
          <td>{{data.realname}}</td>
          <td>{{data.cell}}</td>
          <td>{{data.dept}}</td>
          <td>{{data.rolegroup}}</td>
          <td>{{data.state}}</td>

          <td>

            <nz-divider nzType="vertical"></nz-divider>
            <a nz-button nzType="dashed" (click)="updateAdmin(data.memberid)">修改  </a>
            <nz-divider nzType="vertical"></nz-divider>
            <a nz-button nzType="danger" (click)="deleteAdmin(data.memberid)">删除</a>
          </td>
        </tr>
        </tbody>
      </nz-table>
    </nz-card>

    <ng-template #extraTemplate>
      <a nz-button nzType="primary" [disabled]="activatedNode==null" (click)="addAdmin()">添加</a>
    </ng-template>

  </div>
</div>
